<script setup lang="ts">
	import { ref } from 'vue'
	import { useUserStore } from '@/stores/user'
	import { useUserSetting } from '@/stores/app'

	const { onLogOut } = useUserStore()
	const { settingInfo } = useUserSetting()
	const value = ref(true)
	console.log(settingInfo);
</script>

<template>
	<view class="content">
		<up-navbar title="设置" autoBack border placeholder></up-navbar>
		<view class="footer">
			<view style="margin: 20rpx 28rpx;font-size: 28rpx;">隐私设置</view>
			<up-cell-group :border="false">
				<up-cell label="配送定位，根据位置计算目标到达时间">
					<template #title>
						<up-icon name="/static/icon/dingwei.png" width="48rpx" height="48rpx" label="开启地图位置定位">
						</up-icon>
					</template>
					<template #right-icon>
						<up-switch v-model="value"></up-switch>
					</template>
				</up-cell>
				<up-cell label="实现设置个人头像，上传驾照图片">
					<template #title>
						<up-icon name="/static/icon/paizhao.png" width="48rpx" height="48rpx" label="开启相机拍照权限">
						</up-icon>
					</template>
					<template #right-icon>
						<up-switch v-model="value"></up-switch>
					</template>
				</up-cell>
				<up-cell label="实现设置个人头像，上传驾照图片">
					<template #title>
						<up-icon name="/static/icon/xiangce.png" width="48rpx" height="48rpx" label="开启相册访问权限">
						</up-icon>
					</template>
					<template #right-icon>
						<up-switch v-model="value"></up-switch>
					</template>
				</up-cell>
			</up-cell-group>
			<view style="margin: 20rpx 28rpx;font-size: 28rpx;">功能开启</view>
			<up-cell-group :border="false">
				<up-cell label="打开后将以语音为你播报运输状态">
					<template #title>
						<up-icon name="/static/icon/laba.png" width="48rpx" height="48rpx" label="语音播报">
						</up-icon>
					</template>
					<template #right-icon>
						<up-switch v-model="value"></up-switch>
					</template>
				</up-cell>
			</up-cell-group>
			<view style="margin: 20rpx 28rpx;font-size: 28rpx;">其他</view>
			<up-cell-group :border="false">
				<up-cell>
					<template #title>
						<up-icon name="/static/icon/genxin1.png" width="50rpx" height="50rpx" label="版本更新">
						</up-icon>
					</template>
				</up-cell>
				<up-cell>
					<template #title>
						<up-icon name="/static/icon/guanyu1.png" width="50rpx" height="50rpx" label="关于我们">
						</up-icon>
					</template>
				</up-cell>
				<up-cell>
					<template #title>
						<up-icon name="/static/icon/xieyi1.png" width="50rpx" height="50rpx" label="服务协议">
						</up-icon>
					</template>
				</up-cell>
			</up-cell-group>
			<view class="tuichu" @click="onLogOut">
				<up-icon name="/static/icon/tuichu.png" width="40rpx" height="40rpx" label="退出登录" labelSize="28rpx"
					labelColor="rgba(109, 108, 112, 1)">
				</up-icon>
			</view>
		</view>
	</view>
</template>

<style scoped lang="scss">
	:deep(.u-cell__label) {
		margin-left: 54rpx;
	}

	.content {
		width: 100%;


	}

	.tuichu {
		position: fixed;
		left: 0rpx;
		bottom: 0rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		height: 100rpx;
		box-sizing: border-box;
		padding-bottom: constant(safe-area-inset-bottom);
		/* 兼容iOS < 11.2 */
		padding-bottom: env(safe-area-inset-bottom);
		/* 兼容iOS 11.2及以上 */
		background-color: #fff;
	}
</style>